package com.example.position.demo.service;

import com.example.position.demo.dao.UserRepository;
import com.example.position.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author zhaoerqi
 * @Date 8/27/21
 */
@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    public List<User> findList(){
        return userRepository.findAll();
    }

    public User save(User user){
        return userRepository.save(user);
    }

    public void delete(String id){
        userRepository.deleteById(id);
    }


}
